﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp;
using Volo.Abp.Domain.Values;

namespace Mozhi.Abp.Domain.BasicData
{
    public class Customer : ValueObject
    {
        public Guid Id { get; private set; }

        public string Code {  get; private set; }

        public string Name { get; private set; }

        public bool Activated { get; private set; }

        public void Validate()
        {
            if(!Activated)
                throw new UserFriendlyException($"客户:{Code}-{Name}已禁用", "100000");
        }

        protected override IEnumerable<object> GetAtomicValues()
        {
            throw new NotImplementedException();
        }
    }
}
